package interview;

public class interview_05_07 {
    public int exchangeBits(int num) {
        int[] number=new int[32];
        for(int i=0;i<16;++i){
            int a= num&1;
            num=num>>>1;
            int b=num&1;
            num=num>>>1;
            number[i*2+1]=a;
            number[i*2]=b;
        }
        int result=0;
        for(int i=31;i>=0;--i){
            result=result<<1;
            result+=number[i];
        }
        return result;
    }
}
